<template>
	<view style="width: 100%;margin-top: 10rpx;text-align: right;">
		
		<u-button  class="button-wrap" style="float: right;position:relative;z-index: 33;" :custom-style="customStyle" hover-class="none" :disabled="subDisabled" type="primary"
			@click="communicate">
			{{ $t('即时沟通') }}
		</u-button>
		
		<!--异常反馈-->
		<u-button class="button-wrap" v-show="is_yichang==true&&(order.jylc||order.orderInfo.type=='transport')&& order.orderInfo.status==2&&is_complete==false&&is_take==false"  @click="yichang()" style="float: right;" :custom-style="customStyle" hover-class="none" :disabled="subDisabled" type="primary"
			>
			{{ $t('异常反馈') }}
		</u-button>
		<!--异常反馈-->
		
		
		<!--售后-->
		<u-button class="button-wrap" v-show="after_sales_ing==true" @click="customer()" style="float: right;" :custom-style="customStyle" hover-class="none" :disabled="subDisabled" type="primary"
			>
			<block v-if="after_sales_complete==true">{{ $t('已售后') }}</block>
			<block v-if="after_sales_complete!=true">{{ $t('售后中') }}</block>
		</u-button>
		
		<u-button class="button-wrap" v-show="after_sales_start==true" @click="customer()"  style="float: right;" :custom-style="customStyle" hover-class="none" :disabled="subDisabled" type="primary"
			>
			{{ $t('申请售后') }}
		</u-button>
		
		<u-button class="button-wrap" v-show="after_sales_end==true" style="float: right;" :custom-style="customStyle2" hover-class="none" :disabled="subDisabled" type="primary"
			>
			{{ $t('申请售后') }}
		</u-button>
		<!--售后-->
		
		<!--v-show="is_pipei==true" -->
		<u-button class="button-wrap" @click="pipei()"  style="float: right;line-height: 12px;display: none;" :custom-style="customStyle" hover-class="none" :disabled="subDisabled" type="primary"
			>
			{{ $t('一键匹配') }}
		</u-button>
		
		
		
		<u-button v-if="is_take_qrsh_flag" class="button-wrap" @click="qrsh()" v-show="is_take==true" style="float: right;" :custom-style="customStyle" hover-class="none" :disabled="subDisabled" type="primary"
			>
			{{ $t('确认收货') }}
		</u-button>
		
		<u-button v-else-if="is_take_qrsh1_flag" class="button-wrap" @click="qrsh1()" v-show="is_take==true" style="float: right;" :custom-style="customStyle" hover-class="none" :disabled="subDisabled" type="primary"
			>
			{{ $t('确认收货') }}
		</u-button>
		
		
		<u-button class="button-wrap" v-if="order.role==2&&(order.orderInfo.status!=10&&order.orderInfo.status!=4&&order.orderInfo.status!=5)" @click="qrwc()" v-show="is_complete==true" style="float: right;" :custom-style="customStyle" hover-class="none" :disabled="subDisabled" type="primary"
			>
			{{ $t('确认完成') }}
		</u-button>
		<u-button class="button-wrap" v-else-if="order.role==1&&(order.orderInfo.status!=10&&order.orderInfo.status!=4&&order.orderInfo.status!=5)" @click="qrwc1()" v-show="is_complete==true" style="float: right;" :custom-style="customStyle" hover-class="none" :disabled="subDisabled" type="primary"
			>
			{{ $t('确认完成') }}
		</u-button>
		
		
		<!--关闭订单-->
		<u-button class="button-wrap" v-show="is_close==true" @click="close_order()" style="float: right;" :custom-style="customStyle" hover-class="none" :disabled="subDisabled" type="primary"
			>
			{{ $t('关闭订单') }}
		</u-button>
		<u-button class="button-wrap" v-show="is_close_end==true" style="float: right;" :custom-style="customStyle2" hover-class="none" :disabled="subDisabled" type="primary"
			>
				{{ is_close_end_text }}
		</u-button>
		<!--关闭订单-->
		
		
		<u-button @click="pingjia()" class="button-wrap" v-show="is_comment==true" style="float: right;" :custom-style="customStyle0" hover-class="none" :disabled="subDisabled" type="primary"
			>
			{{ $t('评价') }}
		</u-button>
		
		<vipPopup v-if="vipShow" :show="vipShow" @change="clickVipPopup" />
		
		<view style="clear: both;"></view>
	</view>
</template>

<script>
	import {createC2CConversation} from "@/common/public";
	import {HTTP_REQUEST_URL,HTTP_IMG_UTL,IMAGE_URL} from "@/config/app";
	import vipPopup from "@/components/vipPopup/index.vue";
	
	export default {
		components: {
			
		},
		props:{
			order:{
				type:Object,
				default:{
					goods_step:{
						step:0
					},
					transport_step:{
						step:0
					},
					declaration_step:{
						step:0
					},
					clearance_step:{
						step:0
					}
				}
			},
			nav:{
				type:Array,
				default:[]
			}
		},
		data() {
			return {
				//远程域名
				HTTP_IMG_UTL,
				HTTP_REQUEST_URL,
				IMAGE_URL,
				url: IMAGE_URL,
				
				//语言
				lang: this.$i18n.locale,
				subDisabled: false,	// 表单组件 加载弹窗
				
				//底部导航按钮
				customStyle0: {
					width: '220rpx',
					height: '83rpx',
					marginTop:'20rpx',
					marginRight:'20rpx',
					border: '1px solid #F79B29',
					background:'#ffffff',
					color:'#F79B29',
					fontSize:"24rpx",
					borderRadius: '56rpx'
				},
				customStyle: {
					width: '220rpx',
					height: '83rpx',
					marginTop:'20rpx',
					marginRight:'20rpx',
					background: 'linear-gradient(110deg, #DD2910 0%, #F79B29 100%)',
					fontSize:"24rpx",
					borderRadius: '56rpx'
				},
				customStyle2: {
					width: '220rpx',
					height: '83rpx',
					marginTop:'20rpx',
					marginRight:'20rpx',
					background: '#cccccc',
					fontSize:"24rpx",
					borderRadius: '56rpx'
				},
				
				after_sales_ing:false,
				after_sales_start:false,
				after_sales_end:false,
				after_sales_complete:false,
				
				is_pipei:false,
				is_take_qrsh_flag:false,
				is_take_qrsh1_flag:false,
				is_take:false,
				is_complete:false,
				
				is_close:false,
				is_close_end:false,
				is_close_end_text:this.$t('关闭订单'),
				
				is_comment:false,
				is_yichang:false,
				auth: '',
				
				vipShow: false,
				//后台开关验证 vip权限
				vip:false,
			}
		},
		mounted() {
			var order = this.order
			if((
			(order.orderInfo.status!=10&&order.orderInfo.status!=4&&order.orderInfo.status!=5)&&order.role==1&&order.orderInfo.type=='transport'&&
			(order.orderInfo.release_info.release_type==1||(order.orderInfo.release_info.release_type==3&&order.orderInfo.release_info.human_type==2))
			)
			||
			(
			(order.orderInfo.status!=10&&order.orderInfo.status!=4&&order.orderInfo.status!=5)&&order.role==2&&order.orderInfo.type=='transport'&&
			(order.orderInfo.release_info.release_type==2||(order.orderInfo.release_info.release_type==3&&order.orderInfo.release_info.human_type==1))
			)){
				this.is_take_qrsh_flag = true
			}

			if((order.orderInfo.status!=10&&order.orderInfo.status!=4&&order.orderInfo.status!=5&&order.role==2)&&(order.orderInfo.type=='goods'||order.orderInfo.type=='crossborder')){
				this.is_take_qrsh_flag = true
			}


			
			if((
			(order.orderInfo.status!=10&&order.orderInfo.status!=4&&order.orderInfo.status!=5)&&order.role==2&&order.orderInfo.type=='transport'&&
			(order.orderInfo.release_info.release_type==1||(order.orderInfo.release_info.release_type==3&&order.orderInfo.release_info.human_type==2)))
			||
			(
			(order.orderInfo.status!=10&&order.orderInfo.status!=4&&order.orderInfo.status!=5)&&order.role==1&&order.orderInfo.type=='transport'&&
			(order.orderInfo.release_info.release_type==2||(order.orderInfo.release_info.release_type==3&&order.orderInfo.release_info.human_type==1))
			)){
				this.is_take_qrsh1_flag = true
			}
			
			if((order.orderInfo.status!=10&&order.orderInfo.status!=4&&order.orderInfo.status!=5&&order.role==1)&&(order.orderInfo.type=='goods'||order.orderInfo.type=='crossborder')){
				this.is_take_qrsh1_flag = true
			}


			if(this.order.goods_step==null){ this.order.goods_step = {step:0} }
			if(this.order.transport_step==null){ this.order.transport_step = {step:0} }
			if(this.order.declaration_step==null){ this.order.declaration_step = {step:0} }
			if(this.order.clearance_step==null){ this.order.clearance_step = {step:0} }
			if(this.order.xx_transport_step==null){ this.order.xx_transport_step = {step:0} }
			
			if(this.order.role==1){					
				//参与方  关闭订单按钮
				this.close_order_canyu_button();
				//参与方  一键匹配按钮
				// this.pipei_canyu_btn();
				this.pipei_fabu_btn();
				//参与方  显示异常反馈按钮
				// this.yichang_canyu_btn()
				this.yichang_fabu_btn()
				//发布方 确认收货
				this.take_fabu_btn()
				//发布方评价
				this.pingjia_fabu_btn()
				//发布方  才有售后按钮
				this.customer_fabu_btn()
			}else{   //发布方
			
				//发布方  关闭订单按钮
				this.close_order_fabu_button();
				//发布方  一键匹配按钮
				this.pipei_fabu_btn();
				//发布方  显示异常反馈按钮
				this.yichang_fabu_btn()
				//参与方 确认收货
				this.take_canyu_btn()
				//参与方 评价
				this.pingjia_canyu_btn()
			}
			this.checkShow()
			uni.showLoading({
				title:"Loading...",
				mask:true
			})
			this.getUserAuth() // 获取用户权限

			this.$u.api.user.appCheck().then(res => {
				this.report = res.report
				this.vip = res.vip
			})
		},
		methods:{
			//一键匹配按钮
			pipei(){
				this.$emit('change','pipei',1)
			},
			//发布方 一键匹配按钮
			pipei_fabu_btn(){
				var that = this
				if(this.order&&(this.order.orderInfo.status=='11'||this.order.orderInfo.status=='2')){
					if(this.order.orderInfo.type=='goods'){
						if(this.order.orderInfo.release_info.is_express_price==1){
							if(this.order.role==1){
								this.is_pipei=false
							}else{
								this.is_pipei=false
							}
						}else{
							if(this.order.role==2){
								this.is_pipei=false
							}else{
								this.is_pipei=true
							}
						}
					}
					if(this.order.orderInfo.type=='crossborder'){
						if(this.order.orderInfo.release_info.is_express_price==1){
							if(this.order.role==1){
								this.is_pipei=true
							}else{
								this.is_pipei=false
							}
						}else{
							if(this.order.role==2){
								this.is_pipei=false
							}else{
								this.is_pipei=true
							}
						}
					}
				}
			},
			//参与方 一键匹配按钮
			pipei_canyu_btn(){
				var that = this
				if(this.order&&(this.order.orderInfo.status=='11'||this.order.orderInfo.status=='2')){
					if(this.order.orderInfo.type=='goods'){
						if(this.order.orderInfo.release_info.is_express_price==1){
							this.is_pipei=true
						}
					}
					if(this.order.orderInfo.type=='crossborder'){
						if(this.order.orderInfo.release_info.is_express_price==1){
							this.is_pipei=true
						}
					}
				}
			},
			//发布方 确认收货按钮
			take_fabu_btn(){
				if(this.order.orderInfo.type=='goods'){
					
					if((this.order.goods_step!=null && this.order.goods_step.step==100 && this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate)
					||(this.order.goods_step!=null && this.order.goods_step.step==100 && this.order.orderInfo.releasePayImgList && this.order.orderJoin.releasePayImgList1 && this.order.orderInfo.final_payment&& this.order.orderJoin.final_payment)){
						this.is_take=true
					}
					
					var complete_flag = 1;
					for(var j=0;j<this.nav.length;j++){
						if(this.nav[j].complate==0){
							complete_flag = 0;
						}
					}
					if(complete_flag==0){
						this.is_take=false
					}
					
					
				}else if(this.order.orderInfo.type=='transport'){
					if(this.order.orderInfo.release_info.release_type==2||this.order.orderInfo.release_info.human_type==1){
						
						
						if((this.order.transport_step.step==100 || (this.order.xx_transport_step!=null&&this.order.xx_transport_step.step==100)) && this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						if(this.order.orderInfo.transport_type==1&&(this.order.xx_transportafter_step!=null&&this.order.xx_transportafter_step.step==100)&& this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						if(this.order.orderInfo.transport_type==2&&(this.order.xx_transportport_step!=null&&this.order.xx_transportport_step.step==100)&& this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						if(this.order.orderInfo.transport_type==3&&(this.order.xx_transportquancheng_step!=null&&this.order.xx_transportquancheng_step.step==100)&& this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						if(this.order.orderInfo.transport_type==0&&(this.order.xx_transportquancheng_step!=null&&this.order.xx_transportquancheng_step.step==100)&& this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						
					}else if(this.order.orderInfo.release_info.release_type==1||this.order.orderInfo.release_info.human_type==2){
						if((this.order.transport_step.step==100 || this.order.xx_transport_step.step==100) && this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						if(this.order.orderInfo.transport_type==1&&(this.order.xx_transportafter_step!=null&&this.order.xx_transportafter_step.step==100)&& this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						if(this.order.orderInfo.transport_type==2&&(this.order.xx_transportport_step!=null&&this.order.xx_transportport_step.step==100)&& this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						if(this.order.orderInfo.transport_type==3&&(this.order.xx_transportquancheng_step!=null&&this.order.xx_transportquancheng_step.step==100)&& this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						if(this.order.orderInfo.transport_type==0&&(this.order.xx_transportquancheng_step!=null&&this.order.xx_transportquancheng_step.step==100)&& this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
					}
					
				}else if(this.order.orderInfo.type=='crossborder'){
					if(this.order.orderInfo.release_info.is_express_price==1){						
						if(this.order.orderInfo.release_info.clearance==1&&this.order.declaration_step!=null&&this.order.declaration_step.step==100&&this.order.orderJoin.is_goodslist==1
						&& this.order.orderInfo.payment_proof&& this.order.orderJoin.charge_certificate&&this.order.orderInfo.is_qrsh==0){
							this.is_complete=true
						}else if(this.order.orderInfo.release_info.clearance==2&&this.order.clearance_step!=null&&this.order.clearance_step.step==100&&this.order.orderJoin.is_goodslist==1
						&& this.order.orderInfo.payment_proof&& this.order.orderJoin.charge_certificate&&this.order.orderInfo.is_qrsh==0){
							this.is_complete=true
						}else if(this.order.orderInfo.release_info.clearance==3&&this.order.declaration_step!=null&&this.order.declaration_step.step==100&&this.order.clearance_step!=null&&this.order.clearance_step.step==100&&this.order.orderJoin.is_goodslist==1
						&& this.order.orderInfo.payment_proof&& this.order.orderJoin.charge_certificate&&this.order.orderInfo.is_qrsh==0){
							this.is_complete=true
						}
					}else{
						if(this.order.orderInfo.release_info.clearance==1&&this.order.declaration_step!=null&&this.order.declaration_step.step==100&&this.order.orderJoin.is_goodslist==1
						&& this.order.orderInfo.payment_proof&& this.order.orderJoin.charge_certificate&&this.order.orderInfo.is_qrsh==0){
							this.is_complete=true
						}else if(this.order.orderInfo.release_info.clearance==2&&this.order.clearance_step!=null&&this.order.clearance_step.step==100&&this.order.orderJoin.is_goodslist==1
						&& this.order.orderInfo.payment_proof&& this.order.orderJoin.charge_certificate&&this.order.orderInfo.is_qrsh==0){
							this.is_complete=true
						}else if(this.order.orderInfo.release_info.clearance==3&&this.order.declaration_step!=null&&this.order.declaration_step.step==100&&this.order.clearance_step!=null&&this.order.clearance_step.step==100&&this.order.orderJoin.is_goodslist==1
						&& this.order.orderInfo.payment_proof&& this.order.orderJoin.charge_certificate&&this.order.orderInfo.is_qrsh==0){
							this.is_complete=true
						}
					}
				}
			},
			
			//参与方 确认收货按钮
			take_canyu_btn(){
				
				if(this.order.orderInfo.type=='goods'){
					if((this.order.goods_step!=null && this.order.goods_step.step==100 && this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate)
					||(this.order.goods_step!=null && this.order.goods_step.step==100 && this.order.orderInfo.releasePayImgList && this.order.orderJoin.releasePayImgList1 && this.order.orderInfo.final_payment&& this.order.orderJoin.final_payment)){
						this.is_take=true
					}
					
					var complete_flag = 1;
					for(var j=0;j<this.nav.length;j++){
						if(this.nav[j].complate==0){
							complete_flag = 0;
						}
					}
					if(complete_flag==0){
						this.is_take=false
					}
					
				}else if(this.order.orderInfo.type=='transport'){
					if(this.order.orderInfo.release_info.release_type==2||this.order.orderInfo.release_info.human_type==1){
						if((this.order.transport_step.step==100 || this.order.xx_transport_step.step==100) && this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						if(this.order.orderInfo.transport_type==1&&(this.order.xx_transportafter_step!=null&&this.order.xx_transportafter_step.step==100)&& this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						if(this.order.orderInfo.transport_type==2&&(this.order.xx_transportport_step!=null&&this.order.xx_transportport_step.step==100)&& this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						if(this.order.orderInfo.transport_type==3&&(this.order.xx_transportquancheng_step!=null&&this.order.xx_transportquancheng_step.step==100)&& this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						if(this.order.orderInfo.transport_type==0&&(this.order.xx_transportquancheng_step!=null&&this.order.xx_transportquancheng_step.step==100)&& this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
					}else if(this.order.orderInfo.release_info.release_type==1||this.order.orderInfo.release_info.human_type==2){
						if((this.order.transport_step.step==100 || this.order.xx_transport_step.step==100) && this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						if(this.order.orderInfo.transport_type==1&&(this.order.xx_transportafter_step!=null&&this.order.xx_transportafter_step.step==100)&& this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						if(this.order.orderInfo.transport_type==2&&(this.order.xx_transportport_step!=null&&this.order.xx_transportport_step.step==100)&& this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						if(this.order.orderInfo.transport_type==3&&(this.order.xx_transportquancheng_step!=null&&this.order.xx_transportquancheng_step.step==100)&& this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
						if(this.order.orderInfo.transport_type==0&&(this.order.xx_transportquancheng_step!=null&&this.order.xx_transportquancheng_step.step==100)&& this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
							this.is_take=true
						}
					}
					
					
				}else if(this.order.orderInfo.type=='crossborder'){
					if(this.order.orderInfo.release_info.is_express_price==1){
						if(this.order.orderInfo.release_info.clearance==1&&this.order.declaration_step!=null&&this.order.declaration_step.step==100&&this.order.orderJoin.is_goodslist==1
						&& this.order.orderInfo.payment_proof&& this.order.orderJoin.charge_certificate&&this.order.orderInfo.is_qrsh==0){
							this.is_complete=true
						}else if(this.order.orderInfo.release_info.clearance==2&&this.order.clearance_step!=null&&this.order.clearance_step.step==100&&this.order.orderJoin.is_goodslist==1
						&& this.order.orderInfo.payment_proof&& this.order.orderJoin.charge_certificate&&this.order.orderInfo.is_qrsh==0){
							this.is_complete=true
						}else if(this.order.orderInfo.release_info.clearance==3&&this.order.declaration_step!=null&&this.order.declaration_step.step==100&&this.order.clearance_step!=null&&this.order.clearance_step.step==100&&this.order.orderJoin.is_goodslist==1
						&& this.order.orderInfo.payment_proof&& this.order.orderJoin.charge_certificate&&this.order.orderInfo.is_qrsh==0){
							this.is_complete=true
						}
					}else{
						if(this.order.orderInfo.release_info.clearance==1&&this.order.declaration_step!=null&&this.order.declaration_step.step==100&&this.order.orderJoin.is_goodslist==1
						&& this.order.orderInfo.payment_proof&& this.order.orderJoin.charge_certificate&&this.order.orderInfo.is_qrsh==0){
							this.is_complete=true
						}else if(this.order.orderInfo.release_info.clearance==2&&this.order.clearance_step!=null&&this.order.clearance_step.step==100&&this.order.orderJoin.is_goodslist==1
						&& this.order.orderInfo.payment_proof&& this.order.orderJoin.charge_certificate&&this.order.orderInfo.is_qrsh==0){
							this.is_complete=true
						}else if(this.order.orderInfo.release_info.clearance==3&&this.order.declaration_step!=null&&this.order.declaration_step.step==100&&this.order.clearance_step!=null&&this.order.clearance_step.step==100&&this.order.orderJoin.is_goodslist==1
						&& this.order.orderInfo.payment_proof&& this.order.orderJoin.charge_certificate&&this.order.orderInfo.is_qrsh==0){
							this.is_complete=true
						}
					}
				}
			},
			//发布方评价按钮
			pingjia_fabu_btn(){
				if(this.order.orderInfo.status==10||this.order.orderInfo.status==4){
					this.is_comment=true;
				}
			},
			//参与方评价按钮
			pingjia_canyu_btn(){
				if(this.order.orderInfo.status==10||this.order.orderInfo.status==4){
					this.is_comment=true;
				}
			},
			
			
			communicate() {
				if(that.order.user_id != that.order.release_user.id){
					var toMobile = that.order.release_user.mobile
				}else{
					var toMobile = that.order.join_user.mobile
				}
				createC2CConversation(toMobile, this)
			},
			getUserAuth() {
				const that = this
					that.$u.api.user.getUserAuth().then(res => {
						that.auth = res
							uni.hideLoading()
					})
			},
			checkShow() {// 判断是否显示参与竞标按钮
			  this.$u.api.order.checkJoinShow({
			    release_id: this.releaseId,
			    type: this.releaseType,
			  }).then(res => {
			    if (res.show === true) {
			      this.showJoin = true
			    } else {
			      this.showJoin = false
			    }
			  })
			},
			//关闭订单按钮
			close_order(){
				this.$emit('change','close_order',this.order)
			},
			//发布方 关闭订单按钮
			close_order_fabu_button(){
				var that = this
				if(this.order&&this.order.orderInfo.status=='11'){
					this.is_close=true
					if(this.order&&(this.order.orderInfo.close_reason_time)){
						this.is_close = false
						this.is_close_end = true
					}
					if(this.order.orderInfo.status==2){
						this.is_close = false
					}
					if(this.order.orderInfo.close_status==1){
						this.is_close_end_text = this.$t('订单已关闭')
					}
					if(this.order.orderInfo.close_status==3){
						this.is_close_end_text = this.$t('订单继续交易')
					}
				}
			},	
			//参与方 关闭订单按钮
			close_order_canyu_button(){
				var that = this
				if(this.order&&this.order.orderInfo.status=='11'){
					this.is_close=true
					if(this.order&&(this.order.orderInfo.close_reason_time)){
						this.is_close = false
						this.is_close_end = true
					}
					if(this.order.orderInfo.status==2){
						this.is_close = false
					}
					if(this.order.orderInfo.close_status==1){
						this.is_close_end_text = this.$t('订单已关闭')
					}
					if(this.order.orderInfo.close_status==3){
						this.is_close_end_text = this.$t('订单继续交易')
					}
				}
			},
			
			pingjia(){
				if(this.order.role==2){
					this.$u.route({
						url: "/pages/order/evaluation/evaluation",
						params: {
							order_id: this.order.orderInfo.id,
							type:2,
							order_no:this.order.orderInfo.order_no,
						}
					})
				}else{
					this.$u.route({
						url: "/pages/order/evaluation/evaluation",
						params: {
							order_id: this.order.orderInfo.id,
							type:1,
							order_no:this.order.orderInfo.order_no,
						}
					})
				}
			},
			clickVipPopup() {
				this.vipShow = false
			},
			
			//售后按钮
			customer(){
				this.$emit('change','customer',this.order)
			},
			//发布方才有售后按钮
			customer_fabu_btn(){
				var that = this
				if(this.order&&(this.order.orderInfo.status=='8'||this.order.orderInfo.status=='10'||this.order.orderInfo.status=='4'||this.order.orderInfo.status=='5')){
					if(this.order.orderInfo.is_margin==2){
						this.after_sales_start=true
						if(this.order.orderInfo.aftersales_id){
							this.after_sales_start=false
							this.after_sales_ing=true
							that.$u.api.order.afterSalesRecord({
								aftersales_id: that.order.orderInfo.aftersales_id,
								lang:that.lang
							}).then(result => {
								if((result.release_status==1)||(result.join_status==1)){
									that.after_sales_complete = true
								}
							})
						}
						if((this.order.orderInfo.aftersales_id==0)||(this.order.orderInfo.status=='5')){
							this.after_sales_start=false
							this.after_sales_ing=false
							this.after_sales_end=true
						}
					}
				}
			},
			
			//确认收货按钮弹窗
			qrsh(){
				uni.showModal({ //提醒用户更新
				  title: this.$t('系统提示'),
				  content: this.$t("是否提交确认收货请求，待对方确认收货后，订单将会完成"),
				  confirmText: this.$t('是'), // 修改确认按钮文字
				  cancelText: this.$t('否'),  
				  success: (res) => {
					  if (res.confirm) {
						 const that = this
						 if(that.order.orderInfo.release_info.release_type==1||(that.order.orderInfo.release_info.release_type==3&&that.order.orderInfo.release_info.human_type==2)){
							 var sf=1
						 }else{
							 var sf=0
						 }
						 that.$u.api.order.isQrsh({
						 	id:that.order.orderInfo.join_order_id,
							order_id:that.order.orderInfo.id,
							sf:sf,
						 }).then(res => {
							 that.$emit('on-oversize', 1);
							 
						 })
						  // 用户点击了确定，执行相应的逻辑
					  } else if (res.cancel) {
						  // 用户点击了取消，执行相应的逻辑
					  }
				  }
				})
			},
			
			qrsh1(){
				uni.showModal({ //提醒用户更新
				  title: this.$t('系统提示'),
				  content: this.$t("请确认是否收到货物，点击确认后将完成订单"),
				  confirmText: this.$t('是'), // 修改确认按钮文字
				  cancelText: this.$t('否'),  
				  success: (res) => {
					  if (res.confirm) {
						 const that = this
						 that.$u.api.order.wcOrder({
						 	id:that.order.orderInfo.id,
							join_order_id:that.order.orderInfo.join_order_id
						 }).then(res => {
							 that.$emit('on-oversize', 1);
							 
						 })
						  // 用户点击了确定，执行相应的逻辑
					  } else if (res.cancel) {
						  // 用户点击了取消，执行相应的逻辑
					  }
				  }
				})
			},
			
			//确认完成按钮弹窗
			qrwc(){
				uni.showModal({ //提醒用户更新
				  title: this.$t('系统提示'),
				  content: this.$t("是否提交确认完成请求，待对方确认完成后，订单将会完成"),
				  confirmText: this.$t('是'), // 修改确认按钮文字
				  cancelText: this.$t('否'),  
				  success: (res) => {
					  if (res.confirm) {
						 const that = this
						 that.$u.api.order.isQrwc({
						 	id:that.order.orderInfo.join_order_id
						 }).then(res => {
							 that.$emit('on-oversize', 1);
							 
						 })
						  // 用户点击了确定，执行相应的逻辑
					  } else if (res.cancel) {
						  // 用户点击了取消，执行相应的逻辑
					  }
				  }
				})
			},
			
			qrwc1(){
				uni.showModal({ //提醒用户更新
				  title: this.$t('系统提示'),
				  content: this.$t("请确认是否完成任务，点击确认后将完成订单"),
				  confirmText: this.$t('是'), // 修改确认按钮文字
				  cancelText: this.$t('否'),  
				  success: (res) => {
					  if (res.confirm) {
						 const that = this
						 that.$u.api.order.wcOrder({
						 	id:that.order.orderInfo.id,
							join_order_id:that.order.orderInfo.join_order_id
						 }).then(res => {
							 that.$emit('on-oversize', 1);
							 
						 })
						  // 用户点击了确定，执行相应的逻辑
					  } else if (res.cancel) {
						  // 用户点击了取消，执行相应的逻辑
					  }
				  }
				})
			},
			
			
			//异常反馈按钮
			yichang(){
				this.$emit('change','yichang',this.order)
			},
			//发布方显示异常反馈按钮
			yichang_fabu_btn(){
				var flag = 0;
				var that = this
				if(this.order.orderInfo.type=='transport'){
					if(this.order.orderInfo.release_info.release_type==1 && this.order.role==1&&this.order.orderInfo.status==2){
						flag = 1;
					}else if(this.order.orderInfo.release_info.release_type==1 && this.order.role==2){
						flag = 0;
					}
					if(this.order.orderInfo.release_info.release_type==2 && this.order.role==1){
						flag = 0;
					}else if(this.order.orderInfo.release_info.release_type==2 && this.order.role==2&&this.order.orderInfo.status==2){
						flag = 1;
					}
					if(this.order.orderInfo.release_info.release_type==3){
						if(this.order.orderInfo.release_info.human_type==2){
							if(this.order.role==1&&this.order.orderInfo.status==2){
								flag = 1;
							}else if(this.order.role==2){
								flag = 0;
							}
						}else if(this.order.orderInfo.release_info.human_type==1){
							if(this.order.role==1){
								flag = 0;
							}else if(this.order.role==2&&this.order.orderInfo.status==2){
								flag = 1;
							}
						}	
					}
					// if(this.order.orderInfo.transport_type==1&&(this.order.xx_transportafter_step!=null&&this.order.xx_transportafter_step.step==100)){
					// 	flag=0
					// }
					// if((this.order.transport_step.step==100 || this.order.xx_transport_step.step==100) && this.order.orderInfo.payment_proof && this.order.orderJoin.charge_certificate){
					// 	flag=0
					// }
				}
				if((this.order.orderInfo.type=='goods' || this.order.orderInfo.type=='crossborder') && this.order.role==2){
					flag = 1;
				}else if((this.order.orderInfo.type=='goods' || this.order.orderInfo.type=='crossborder') && this.order.role==1){
					flag = 0;
				}
				if(flag==1){
					this.is_yichang = true
				}else{
					this.is_yichang = false
				}
			},
			//参与方显示异常反馈按钮
			yichang_canyu_btn(){
				var flag = 1;
				var that = this
				if(this.order.orderInfo.type=='transport'){
					if(this.order.orderInfo.release_info.release_type==1){
						flag = 0;
					}
					if(this.order.orderInfo.release_info.release_type==3){
						if(this.order.orderInfo.release_info.human_type==2){
							flag = 0;
						}
					}
				}
				if(flag==1){
					this.is_yichang = true
				}
			}
			
			
		},
		
	}
</script>

<style lang="scss" scoped>
	.button-wrap {
	  white-space: normal; /* 允许文本换行 */
	  word-break: break-all; /* 如果需要在任意字符间断开，使用这个属性 */
	  line-height: 24rpx;
	}
</style>